﻿using System.Collections.Generic;
using OneBusAway.Util;

namespace OneBusAway.Entities
{
    public class Stop
    {
        [FromXml("id")]
        public string Id { get; set; }

        [FromXml("lat", Converter = "ToDouble")]
        public double Latitude { get; set; }
        
        [FromXml("lon", Converter = "ToDouble")]
        public double Longitude { get; set; }
        
        [FromXml("direction")]
        public string Direction { get; set; }

        [FromXml("name")]
        public string Name { get; set; }

        [FromXml("code")]
        public string Code { get; set; }

        public IEnumerable<Route> Routes { get; set; }

        public static double ToDouble(string value)
        {
            return double.Parse(value);
        }
    }
}
